﻿package AssetClass
{
	import base.BaseAsset;
	import base.BaseHero;
	
	import com.dusk.net.AssetLoader;
	import com.game.manager.GameSceneManager;
	import com.game.module.backpack.view.BackPack;
	
	import flash.events.Event;
	
	public class BackPackInter extends BaseAsset
	{
		public function BackPackInter()
		{
			super(BackPack);
		}
		
		private var owner:BaseHero;
		
		public function setPackOwner(owner:*):void
		{
			this.owner = owner;
			this.loadAssets("BackPack");
		}
		
		protected override function __onComplete(param1:Event = null):void
		{
			var pack:BackPack = new this.targetClass();
			pack.setPackOwner(this.owner);
			this.owner = null;
			GameSceneManager.getIns().addScene(pack);
			AssetLoader.getIns().removeEventListener(AssetLoader.ALL_LOAD_COMPLETE, __onComplete);
			AssetLoader.getIns().removeEventListener(AssetLoader.LOAD_FAILED, __onFailed);
			destroy();
		}
	}
}